package reflect;

import java.lang.reflect.Constructor;

public class Test {
    public static void main(String[] args) throws Exception {
        Class cls1 = Class.forName("reflect.Student");
        Constructor c = cls1.getConstructor(String.class,int.class,char.class);
        Object obj = c.newInstance("张麒",18,'女');
        System.out.println( obj);

        Constructor c1 = cls1.getConstructor();//无参构造方法
        Object obj1 = c1.newInstance();
        System.out.println( obj1);

    }
}
